<?php

namespace Orqlog\YacampaignDrawLaravel\Domain\Service;

use Orqlog\Yacampaign\Domain\Service\CampaignService;
use Orqlog\YacampaignDrawLaravel\Contracts\DrawCampaignRepositoryContract;

class DrawCampaignService extends CampaignService {

    public function __construct()
    {
        $this->campaignRepository = app()->make(DrawCampaignRepositoryContract::class);
    }

    /**
     * Create or update the campaign
     */
    public function saveCampaign(array $data) :void
    {
        $drawCampaign = $this->campaignRepository->makeCampaign($data);
        $this->campaignRepository->add($drawCampaign);
    }

    /**
     * delete campaign
     */
    public function deleteCampaign(int $campaignId) :void 
    {
        $this->campaignRepository->remove($campaignId);
    }

    /**
     * Decide prize
     */
    public function decidePrize(int $userId, int $campaignId): array
    {
        return [];
    }
    
}
